package com.course_design.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.course_design.dao.TeacherMapper;
import com.course_design.entity.Teacher;
import com.course_design.entity.TeacherExample;

@Service
public class TeacherService {
	@Autowired
	private TeacherMapper teacherMapper;
	
	public Teacher queryTeacherInfo(Teacher teacher) {
		TeacherExample example=new TeacherExample();
		TeacherExample.Criteria criteria=example.createCriteria();
		criteria.andTeacherphoneEqualTo(teacher.getTeacherphone());
		criteria.andTeacherpasswordEqualTo(teacher.getTeacherpassword());
		List<Teacher> teachers=teacherMapper.selectByExample(example);
		if(teachers.size()>0) {
			return teachers.get(0);
		}
		return null;
	}
}
